<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>

</body>
<script>
    /* 
    描述：小明家里有三个人，爸爸和妈妈，小明是男的，
    今年18岁，兴趣爱好是打篮球和读书，爸爸是软件程序员，
    妈妈是UI设计师，小明家在深圳南山有一套100平方的房子，
    户型是三房一厅，今年小明家刚买了一辆特斯拉Model3.
     */
    // 小明
    let xiaoming = new Object();
    xiaoming.sex = "男";
    xiaoming.age = 18;
    xiaoming.hobby = "打篮球和读书";
    // 爸爸
    let baba = new Object();
    baba.job = "软件程序员";
    console.log(baba);
    // 妈妈
    let 　mama = new Object();
    mama.job = "UI设计师";
    console.log(mama);
    // 车
    let che = new Object();
    che.model = "特斯拉";
    console.log(che);
    // 房子
    let house = new Object();
    house.size = "100平";
    house.type = "三室一厅";
    house.address = "深圳南山";
    console.log(house);
    // console.log(xiaoming);
    // 假设我不知道小明 里面有什么属性
    // 数组的遍历
    // let arr  =[1,2,3];
    // for(let i=0; i<arr.length;i++){
    //     console.log(arr[i]);
    // }
    // 通过 for in 遍历属性
    for(let key in xiaoming){
       // console.log(key);
        console.log(key,":",xiaoming[key]);
    }


</script>

</html>